<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>第一个 Strtus2程序</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

</head>

<body>
<s:fielderror></s:fielderror>
原始类型和包装类型显示：<br>
	信息:<s:property value="massage"/>
	<br>
	用户名:<s:property value="user.name"/>
	国籍:<s:property value="user.address.country"/>
	
	<hr>
	显示数组:<s:iterator value="numbers">
			<s:property/>
		  </s:iterator>
		  <!-- 集合数组 -->
		  <s:property value="numbers[0]"/>
		  <s:property value="numbers.length"/>
	<hr>
	显示list:<s:iterator value="hobbies">
			<s:property/>
		  </s:iterator>
		  
	<hr>
	显示list User:<s:iterator value="users" id="user">
			<s:property value="name"/>
		  </s:iterator>
	<hr>
		  <!-- Data类型 -->
	显示日期类型:
		1:<s:date name="timeData" format="yyyy/MM/dd"/>
		2:<s:property value="timeData"/>
		
	<hr>
	创建集合对象:
	<s:set name="userList" value="{'Jason','Tom','Marray'}"/>
	<s:property value="#userList[1]"/>
	<!-- 统计元素个数 -->
	<s:property value="#userList.size"/>
	
	<hr>
	创建Map:
	<s:set name="map" value="#{'cn':'China','us':'the United States'}"/>
	<s:property value="#map.cn"/>
	<s:property value="#map['cn']"/>
	
	<hr>
	访问非值栈对象:
	<s:set name="age" value="20" scope="request"/>
	<s:set name="username" value="Jason" scope="session"/>
	<s:set name="count" value="5" scope="application"/>
	
	<!-- 取值 -->
	#request.age:<s:property value="#request.age"/>
	#session.username:<s:property value="#session.username"/>
	#application.count:<s:property value="#application.count"/>
	#attr.count:<s:property value="#attr.count"/>
	
	<hr>演示字符串常量:
	<s:set name="country1" value="China"/>
	<s:set name="country2" value="'China'"/>
	#country1:<s:property value="#country1"/><br>
	#country2:<s:property value="#country2"/><br>
	#request.country2:<s:property value="#request.country2"/><br>
	
</body>
</html>
